package com.hp.service.impl;

import com.hp.entity.Drug;
import com.hp.mapper.DrugMapper;
import com.hp.service.DrugService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class DrugServiceImpl implements DrugService {
    @Autowired
    private DrugMapper drugMapper;

    /**
     * 药物查询
     */
    @Override
    public List<Drug> findAll(Drug drug) {
        return drugMapper.findAll(drug);
    }

    /**
     * 删除
     */
    @Override
    public int del(Integer id) {
        return drugMapper.del(id);
    }
    /**
     * 根据id查询
     */
    @Override
    public Drug findById(Integer id) {
        return drugMapper.findById(id);
    }
    /**
     * 修改
     */
    @Override
    public int update(Drug drug) {
        return drugMapper.update(drug);
    }

    /**
     * 添加
     */
    @Override
    public int add(Drug drug) {
        return drugMapper.add(drug);
    }

    /*
    添加库存数量
     */
    @Override
    public int upd(Drug drug) {
        return drugMapper.upd(drug);
    }


}
